package cz.czu.pef.DataModelling.ejb.impl;

import java.util.Collection;
import java.util.List;

import cz.czu.pef.DataModelling.dao.DaoBasic;
import cz.czu.pef.common.CustomFilterField;
import cz.czu.pef.common.CustomSortField;

public abstract class AbstractEjbImpl<T> implements DaoBasic<T>
{
  public abstract DaoBasic<T> getDaoBasic();

  @Override
  public T getByStringId(String myKey)
  {
    return getDaoBasic().getByStringId(myKey);
  }

  @Override
  public void persist(T entity)
  {
    getDaoBasic().persist(entity);
  }

  @Override
  public T getById(long id)
  {
    return getDaoBasic().getById(id);
  }

  @Override
  public T getByIdLocked(long id)
  {
    return getDaoBasic().getByIdLocked(id);
  }

  @Override
  public void remove(T entity)
  {
    getDaoBasic().remove(entity);
  }

  @Override
  public void removeById(long id)
  {
    getDaoBasic().removeById(id);
  }

  @Override
  public T merge(T entity)
  {
    return getDaoBasic().merge(entity);
  }

  @Override
  public T mergeUnique(String attribName, Object value, T entity)
  {
    return getDaoBasic().mergeUnique(attribName, value, entity);
  }

  @Override
  public T mergeUniqueExt(String[] attribNames, Object[] values, T entity)
  {
    return getDaoBasic().mergeUniqueExt(attribNames, values, entity);
  }

  @Override
  public Long count()
  {
    return getDaoBasic().count();
  }

  @Override
  public Long countWithFilter(List<CustomFilterField> filterFields)
  {
    return getDaoBasic().countWithFilter(filterFields);
  }

  @Override
  public List<T> findByAttributeIn(String attribName, Collection<? extends Object> value)
  {
    return getDaoBasic().findByAttributeIn(attribName, value);
  }

  @Override
  public List<T> findByAttribute(String attribName, Object value)
  {
    return getDaoBasic().findByAttribute(attribName, value);
  }

  @Override
  public T findByAttributeUniqueResult(String attribName, Object value)
  {
    return getDaoBasic().findByAttributeUniqueResult(attribName, value);
  }

  @Override
  public List<T> findAll()
  {
    return getDaoBasic().findAll();
  }

  @Override
  public List<T> findAllByRange(Integer firstRow, Integer endRow)
  {
    return getDaoBasic().findAllByRange(firstRow, endRow);
  }

  @Override
  public List<T> findAllByRangeWithFilter(Integer firstRow, Integer endRow, List<CustomFilterField> filterFields)
  {
    return getDaoBasic().findAllByRangeWithFilter(firstRow, endRow, filterFields);
  }

  @Override
  public List<T> findAllByRangeWithFilterAndSort(Integer firstRow, Integer endRow, List<CustomFilterField> filterFields, List<CustomSortField> sortFields)
  {
    return getDaoBasic().findAllByRangeWithFilterAndSort(firstRow, endRow, filterFields, sortFields);
  }
}
